<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/base2.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/style2.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
		<title>账户管理-添加账号</title>
	</head>
	<body>
		<div class="page">
			<div class="main_menu fl">
				<c:forEach items="${sessionScope.MENU_LIST}" var="mainMenu">
					<c:if test="${mainMenu.wOOpid == 4}">
						<div class="menu_name">
							<a href="${pageContext.request.contextPath}/${mainMenu.wOAction}"
								target="main"> <img
								src="${pageContext.request.contextPath}${mainMenu.wOIcon}">
								<p>${mainMenu.wOName}</p>
							</a>
						</div>
					</c:if>
				</c:forEach>
			</div>
				<div class="main_cont fl">
					<div class="main_cont_top">
						<div class="main_inner clearfix">
						
							<div class="cont_top_time fr"><i><img src="${pageContext.request.contextPath}/images/images/refresh.png">刷新</i></div>
						</div>
					</div>
					<div class="main_cont_bottom">
						<div class="main_inner">
							<form action="${pageContext.request.contextPath}/admin/add.json" method="post" id="myform" class="add_bacth">
								<p>账户名：<input type="text" value="" class="w200" id="wAUsername" name="wAUsername"></p>
								<p>所属渠道商:<select class="w200" id="wASupplierId" name="wASupplierId">
									  <c:forEach items="${SUPPLIER_LIST}" var="supplier">
										<option value="${supplier.id}">${supplier.wSName}</option>
									  </c:forEach>
								</select></p>
								<p>角&nbsp;&nbsp;&nbsp;&nbsp;色：
								<select class="w200" id="wARoleId" name="wARoleId">
								<c:forEach items="${ROLE_LIST}" var="role">
									<option value="${role.id}">${role.wRName}</option>
        						</c:forEach>
								</select>
								<input type="hidden" id="wARealName" name="wARealName">
								</p>
								<p>状&nbsp;&nbsp;&nbsp;&nbsp;态：
								<input type="button" value="启用" class="w80 mr15 on" onclick="changeStatus(1)">
								<input type="button" value="停用" class="w80" onclick="changeStatus(0)">
								<input type="hidden" id="status" name="status" value="1">
								</p>
								<p>密&nbsp;&nbsp;&nbsp;&nbsp;码：账号统一密码为123456，请登录后立即修改！</p>
								<p class="add_bacth_btn ml20">
								<input type="button" value="取消" onclick="clearValue();">
								<input type="button" value="确认添加" onclick="checkValue();"></p>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(".add_bacth .w80").click(function(){
				$(".add_bacth .w80").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			
			function clearValue(){
				$("#wAUsername").val("");
			}
			
			function changeStatus(num){
				$("#status").val(num);
			}
			
			function checkValue(){
				var username=$("#wAUsername").val();
				if(username==null || username==""){
					alert("账户名不能为空！");
					return false;
				}
				
				var tests=$("#wARoleId").find("option:selected").text();
				$("#wARealName").val(tests);
				
				$("#myform").submit();
			}
		</script>
	</body>
</html>
